/**
 * 固定表格高度：.avue-main - .avue-tags - .avue-crud-search
 *
 * */

// export default function () {
//     let height;
//         //方法内容
//     let avueMain = document.getElementsByClassName("avue-main")[0].clientHeight;
//     let avueTags = document.getElementsByClassName("avue-tags")[0].clientHeight;
//     let avueCrud = document.getElementsByClassName("avue-crud-search")[0].clientHeight;
//     height = avueMain - avueTags - avueCrud
//
//     return height - 40 - 40 - 16 -22 -8 -30
// }
exports.install = function (Vue, options) {
    Vue.prototype.tableHeight = function () {
        let height;
        //方法内容
        let avueCrud;
        let avueMain = document.getElementsByClassName("avue-main")[0].clientHeight;
        let avueTags = document.getElementsByClassName("avue-tags")[0].clientHeight;
        if (document.getElementsByClassName("avue-crud__search")[0] && document.getElementsByClassName("avue-crud__menu")[0]) {
            avueCrud = document.getElementsByClassName("avue-crud__search")[0].clientHeight + document.getElementsByClassName("avue-crud__menu")[0].clientHeight;
        } else if (document.getElementsByClassName("avue-crud__menu")[0]) {
            avueCrud = document.getElementsByClassName("avue-crud__menu")[0].clientHeight;
        } else if (document.getElementsByClassName("avue-crud__search")[0]) {
            avueCrud = document.getElementsByClassName("avue-crud__search")[0].clientHeight;
        } else {
            avueCrud = 0;
        }
        console.log(avueCrud)
        height = avueMain - avueTags - avueCrud
        console.log(height)
        return height - 40 - 40 - 16 - 8 - 30
    };
};